using System;
using UnityEngine;

public enum EPanel
{
    First,
    Second,
}

public enum E3DPanel
{
    Left,
    Right,
    Middle,
}

public class GameManager : MonoBehaviour
{
    public static GameManager mInstance;
    public UIManager mUIManager;
    public UI3DManager mUI3DManager;

    public EPanel eCurPanelType;
    public E3DPanel eCur3DPanelType;

    private void Awake()
    {
        if (!mInstance)
        {
            mInstance = gameObject.GetComponent<GameManager>();
        }
    }

    private void Start()
    {
        OpenPanelByEnum(EPanel.First);
        Open3DPanelByEnum(E3DPanel.Middle);
    }

    /// <summary>
    /// 打开第一二场景的界面
    /// </summary>
    /// <param name="type"></param>
    public void OpenPanelByEnum(EPanel type)
    {
        eCurPanelType = type;
        mUIManager.OpenPanelByEnum(type);
        mUI3DManager.Open3DPanelByEnum(type);
    }
    
    /// <summary>
    /// 打开3D的左右界面开关
    /// </summary>
    /// <param name="type"></param>
    public void Open3DPanelByEnum(E3DPanel type)
    {
        eCur3DPanelType = type;
        mUI3DManager.Open3DPanelByEnum(type);
    }
}
